<html>
 <head><title>Untitled Document</title>
<style type="text/css">
.Comment {
color: #960;
}
.Comment {
color: #960;
}
.Message {
color: #960;
}
.Title {
color: #960;
}
.UserName {
color: #960;
}
</style>
</head>
<body>

<legend><h1 class="Comment">Comment</h1></legend>
<form method="post" action="comment.php" > 
<table>
<tr>
<td bgcolor=> <strong class="UserName">UserName </strong>: </td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td bgcolor=><strong class="Title">Title</strong>:</td>
<td><input type="text" name="title"></td>
</tr>
<tr>
<td bgcolor=><strong class="Message">Message</strong>:</td>
<td><textarea name="message" rows="10" cols="50"></textarea></td>
</tr>
<br/><br/>

<tr>
<td><input name="sub" type="submit" value="submit"/></td>
<td><input name="res" type="reset" value="reset"/></td>

</tr>

</table>
</form>
<div>
<img src="http://campus.sanook.com/story_picture/s/04117_043.gif" width="240" height="150"/>
<br/> <br/> <br/> 
</div>

<?php


if(!is_null($_POST['title']))
{
$conn=odbc_connect('SourceDb','','');
$sql="insert into message(username,title, message) values('$_POST[username]','$_POST[title]','$_POST[message]'); ";
$rs=odbc_exec($conn,$sql);
}

?>
 <?php
$conn=odbc_connect('SourceDb','','');
$sql="select * from message";
$exec = odbc_exec($conn, $sql); 
odbc_result_all($exec,"border=1"); 
odbc_free_result($exec); 
odbc_close($conn); 
?> 


</body>
</html>
